package com.hziee.mail.controller;

import com.hziee.mail.service.ClassifyService;
import com.hziee.mail.util.FormatReturn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author ZX
 */
@RestController
@RequestMapping("/classify")
public class ClassifyController extends FormatReturn {

    @Autowired
    private ClassifyService classifyService;

    @GetMapping("/classify_left_all")
    public String classifyLeft(HttpServletResponse response) {
        HashMap<String, Object> map = classifyService.findclassifyLeft();
        return ajaxReturn(response, map);
    }

    @GetMapping("/classify_right_all")
    public String classifyRight(HttpServletResponse response, String productClassId) {
        List<Map> list = classifyService.findclassifyRight(productClassId);
        return ajaxReturn(response, list);
    }

}
